package Cn.Sarkar.MMS.DataBaseDefinations.Independent

import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.*
import Cn.Sarkar.MMS.DataBaseDefinations.Additional.Contacts
import Cn.Sarkar.MMS.DataBaseDefinations.Additional.Names
import Cn.Sarkar.Entities.Common.Table

object Persons : Table("Person") {
    override var Comment: String = "ئادەملەر"
    val NameID = intColumn("NameID") unsigned true notNull true reference Names.ID comment "ئىسمى"
    val ContactID = intColumn("ContactID") unsigned true notNull true reference Contacts.ID comment "ئالاقە ئۇسۇلى"
    val BirthDay = dateTimeColumn("BirthDay") notNull true comment "تۇغۇلغان كۈنى"
    val IDCardNumber = charColumn("IDCardNumber") isN false size 16 comment "كىملىك نومۇرى"
    init {
        index(BirthDay)
    }

    override val CATEGORY: Int = 14
}